save_pnas_pdf <- function(plot, file, width = "single", height_cm = 6, bg = "white") {
  if (width == "single") {
    width_cm <- 8.7
  } else if (width == "double") {
    width_cm <- 17.4
  } else if (width == "intermediate") {
    width_cm <- 11.4
  } else {
    stop("Invalid width")
  }
  inches <- c(width_cm/2.54, height_cm/2.54)
  ggplot2::ggsave(
    filename = file, plot = plot,
    width = inches[1], height = inches[2], units = "in",
    device = cairo_pdf,
    bg = bg,
    scale = 1.5
  )
}